<template>
  <div>
    <component  :is="myComponent"></component>
  </div>
</template>

<script>
import province from './province';
import city from './city';
import didiao from './didiao';
export default {
  name: "business",
  components:{
    province,
    city,
    didiao
  },
  props:{
    subComp:{
      type: String,
      default: 'province'
    },
  },
  data() {
    return {
      myComponent:null,
    }
  },
  computed:{
    mapLevel: {
      get() { return this.$store.state.home.mapLevel },
    }
  },
  mounted() {
    this.load();
  },
  methods:{
    load(){
      if(this.mapLevel=='1'){
        if(this.subComp!=undefined){
          this.myComponent=this.subComp;
        }else{
          this.myComponent=province;
        }
      }else{
        this.myComponent=city;
      }
    }
  }
}
</script>

<style scoped>

</style>
